#ifndef timer_custom_h
#define timer_custom_h

#include <sys/time.h>

typedef struct timeval time_custom;

inline time_custom getTimeNow(){
    time_custom time_;
    gettimeofday(&time_,NULL);
    return time_;    
}

inline double diff(time_custom time1, time_custom time0){
    double t1 = double(time1.tv_sec) + double(time1.tv_usec) / 1000000.0;
    double t0 = double(time0.tv_sec) + double(time0.tv_usec) / 1000000.0;
    return t1 - t0;

}


#endif //timer_custom_h
